<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(         
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name' => 'Game bài, Chơi bài online, Đánh bài miễn phí',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                'application.widgets.*',
	),
        'modules' => array(
            // uncomment the following to enable the Gii tool
            'gii' => array(
                'class' => 'system.gii.GiiModule',
                'password' => 'game!@##@!',
                // If removed, Gii defaults to localhost only. Edit carefully to taste.
                'ipFilters' => array('127.0.0.1'),
            ),
            'admin',
         ),

	'defaultController'=>'site',

	// application components
	'components'=>array(
		'user'=>array(
                    'class' => 'WebUser',
                    // enable cookie-based authentication
                    'allowAutoLogin'=>true,
		),	
                
                'clientScript' => array(
                    'class' => 'ext.EClientScript.EClientScript',
                    'combineScriptFiles' => !YII_DEBUG, // By default this is set to true, set this to true if you'd like to combine the script files
                    'combineCssFiles' => !YII_DEBUG, // By default this is set to true, set this to true if you'd like to combine the css files
                    'optimizeScriptFiles' => !YII_DEBUG, // @since: 1.1
                    'optimizeCssFiles' => !YII_DEBUG, // @since: 1.1
                    'optimizeInlineScript' => false, // @since: 1.6, This may case response slower
                    'optimizeInlineCss' => false, // @since: 1.6, This may case response slower
                  ),    
            
                'mobiledetect' => array(
                    'class' => 'MobileDetect',            
                ),	
                'simpleImage'=>array(
                        'class' => 'application.extensions.CSimpleImage',
                ),
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=210.211.124.135;dbname=mydb',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'skynet@2014',
			'charset' => 'utf8',
			'tablePrefix' => '',                       
		),	
                	
                
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
                        'showScriptName' => false,
			'rules'=>array(				
                                'admin'=>array('admin'),                                
                                'tin-tuc'=>array('post/news', 'caseSensitive'=>false),
                                'huong-dan'=>array('post/guide', 'caseSensitive'=>FALSE),                                
                                '<slug>' => array('post/detail', 'caseSensitive' => false),
                                'nen-tang/<pcode>' => array('site/index', 'caseSensitive' => false),
                                'game/<id>' => array('site/detail', 'caseSensitive' => false),
                                'gii' => 'gii',
                                'gii/<controller:\w+>' => 'gii/<controller>',
                                'gii/<controller:\w+>/<action:\w+>' => 'gii/<controller>/<action>',
                                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',                        				
			),
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),
        'theme' => 'smartphone',
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
        'params' => array(
            // this is used in contact page
            'adminEmail' => 'thanhnguyendinh89@gmail.com',
            'baseUrl'=> ''
        )	
);